using System;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace VC.Framework.Controls.Phone
{
    public partial class FrmPhoneEdit : XtraForm
    {
        private BindingSource _bsPhoneParse = new BindingSource();
        private PhoneParse _phoneParse;

        public FrmPhoneEdit(string phoneString)
        {
            InitializeComponent();

            _phoneParse = new PhoneParse(phoneString);
            _bsPhoneParse.DataSource = _phoneParse.ListPhone;
            _gPhone.DataSource = _bsPhoneParse;
        }

        public string GetPhoneString()
        {
            _bOk.Select();
            return _phoneParse.GetPhoneString();
        }

        private void _bExit_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        private void _bCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }
    }
}